<?php if($state):?>
<?php
	$link  = 'appid='.urlencode($jsApiParameters['appId']);
	$link .= '&noncestr='.urlencode($jsApiParameters['nonceStr']);
	$link .= '&package=WAP';
	$link .= '&'.urlencode($jsApiParameters['package']);
	$link .= '&timestamp='.urlencode($jsApiParameters['timestamp']);
	$link .= '&sign='.urlencode($jsApiParameters['paySign'])
	?>
<script>
ajax_go_to_pay_ = function(){
	var link = '<?php echo 'weixin://wap/pay?'.urlencode($link)?>';
	console.log(link);
	//location.href = link;
}
</script>
<?php else:?>
<script>
ajax_go_to_pay_ = function(){
    alert('<?php echo $msg?>');
};
</script>
<?php endif;?>